#include <stdio.h>
#include <string.h>

int main()
{
     // 计算最大公约数
    int m = 18;
    int n = 24;
    int r = 0;
    while (r=m%n)
    {
        printf("r = %d \n",r);
        m = n;
        n = r;
    }
    printf("%d \n",n);
    
    return 0;
}